﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SevenZip;

namespace MS.Utility.RAR
{
    public class UnCompress
    {
        /// <summary>
        /// 解压缩
        /// </summary>
        /// <param name="path"></param>
        /// <param name="sevenzPath">Server.MapPath("/Zip/7z.dll")</param>
        /// <param name="rarFile"></param>
        /// <param name="rarName"></param>
        /// <returns></returns>
        public bool UnRAR(string path, string sevenzPath, string rarFile)
        {
            SevenZipExtractor.SetLibraryPath(sevenzPath);
            SevenZipExtractor extr = new SevenZipExtractor(rarFile);

            extr.ExtractArchive(path);
            extr.Dispose();
            return true;
        }
    }
}
